package com.github.catvod.spider.merge;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.Stack;
import java.util.regex.Pattern;
import javax.annotation.Nullable;

public final class ZG {
  private static Pattern V0;
  
  static final String[] h = new String[] { 
      "", " ", "  ", "   ", "    ", "     ", "      ", "       ", "        ", "         ", 
      "          ", "           ", "            ", "             ", "              ", "               ", "                ", "                 ", "                  ", "                   ", 
      "                    " };
  
  private static final ThreadLocal<Stack<StringBuilder>> j;
  
  static {
    V0 = Pattern.compile("^/((\\.{1,2}/)+)");
    j = new Tw();
  }
  
  public static boolean BQ(int paramInt) {
    return (paramInt == 8203 || paramInt == 173);
  }
  
  public static String F8(int paramInt) {
    if (paramInt >= 0) {
      String[] arrayOfString = h;
      if (paramInt < arrayOfString.length)
        return arrayOfString[paramInt]; 
      int i = Math.min(paramInt, 30);
      char[] arrayOfChar = new char[i];
      for (paramInt = 0; paramInt < i; paramInt++)
        arrayOfChar[paramInt] = ' '; 
      return String.valueOf(arrayOfChar);
    } 
    IllegalArgumentException illegalArgumentException = new IllegalArgumentException("width must be > 0");
    throw illegalArgumentException;
  }
  
  public static boolean I(int paramInt) {
    return (paramInt == 32 || paramInt == 9 || paramInt == 10 || paramInt == 12 || paramInt == 13 || paramInt == 160);
  }
  
  public static String Qy(Collection<?> paramCollection, String paramString) {
    return oq(paramCollection.iterator(), paramString);
  }
  
  public static StringBuilder V0() {
    StringBuilder stringBuilder;
    Stack stack = j.get();
    if (stack.empty()) {
      stringBuilder = new StringBuilder(8192);
    } else {
      stringBuilder = stringBuilder.pop();
    } 
    return stringBuilder;
  }
  
  public static boolean W(String paramString) {
    if (paramString == null || paramString.length() == 0)
      return false; 
    int i = paramString.length();
    for (byte b = 0; b < i; b++) {
      if (!Character.isDigit(paramString.codePointAt(b)))
        return false; 
    } 
    return true;
  }
  
  public static void h(StringBuilder paramStringBuilder, String paramString, boolean paramBoolean) {
    // Byte code:
    //   0: aload_1
    //   1: invokevirtual length : ()I
    //   4: istore #8
    //   6: iconst_0
    //   7: istore #4
    //   9: iconst_0
    //   10: istore #6
    //   12: iconst_0
    //   13: istore #5
    //   15: iload #4
    //   17: iload #8
    //   19: if_icmpge -> 132
    //   22: aload_1
    //   23: iload #4
    //   25: invokevirtual codePointAt : (I)I
    //   28: istore #9
    //   30: iload #9
    //   32: invokestatic I : (I)Z
    //   35: ifeq -> 85
    //   38: iload_2
    //   39: ifeq -> 54
    //   42: iload #6
    //   44: istore #7
    //   46: iload #5
    //   48: istore_3
    //   49: iload #6
    //   51: ifeq -> 112
    //   54: iload #5
    //   56: ifeq -> 69
    //   59: iload #6
    //   61: istore #7
    //   63: iload #5
    //   65: istore_3
    //   66: goto -> 112
    //   69: aload_0
    //   70: bipush #32
    //   72: invokevirtual append : (C)Ljava/lang/StringBuilder;
    //   75: pop
    //   76: iconst_1
    //   77: istore_3
    //   78: iload #6
    //   80: istore #7
    //   82: goto -> 112
    //   85: iload #6
    //   87: istore #7
    //   89: iload #5
    //   91: istore_3
    //   92: iload #9
    //   94: invokestatic BQ : (I)Z
    //   97: ifne -> 112
    //   100: aload_0
    //   101: iload #9
    //   103: invokevirtual appendCodePoint : (I)Ljava/lang/StringBuilder;
    //   106: pop
    //   107: iconst_1
    //   108: istore #7
    //   110: iconst_0
    //   111: istore_3
    //   112: iload #4
    //   114: iload #9
    //   116: invokestatic charCount : (I)I
    //   119: iadd
    //   120: istore #4
    //   122: iload #7
    //   124: istore #6
    //   126: iload_3
    //   127: istore #5
    //   129: goto -> 15
    //   132: return
  }
  
  public static URL iU(URL paramURL, String paramString) {
    String str2 = paramString;
    if (paramString.startsWith("?")) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append(paramURL.getPath());
      stringBuilder.append(paramString);
      str2 = stringBuilder.toString();
    } 
    URL uRL = new URL(paramURL, str2);
    paramString = V0.matcher(uRL.getFile()).replaceFirst("/");
    String str1 = paramString;
    if (uRL.getRef() != null) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append(paramString);
      stringBuilder.append("#");
      stringBuilder.append(uRL.getRef());
      str1 = stringBuilder.toString();
    } 
    return new URL(uRL.getProtocol(), uRL.getHost(), uRL.getPort(), str1);
  }
  
  public static boolean j(String paramString, String... paramVarArgs) {
    int i = paramVarArgs.length;
    for (byte b = 0; b < i; b++) {
      if (paramVarArgs[b].equals(paramString))
        return true; 
    } 
    return false;
  }
  
  public static String n(String paramString1, String paramString2) {
    try {
      URL uRL = new URL();
      this(paramString1);
      try {
        return iU(uRL, paramString2).toExternalForm();
      } catch (MalformedURLException malformedURLException) {
        return "";
      } 
    } catch (MalformedURLException malformedURLException) {
      URL uRL = new URL();
      this(paramString2);
      return uRL.toExternalForm();
    } 
  }
  
  public static boolean oC(String paramString) {
    if (paramString != null && paramString.length() != 0) {
      int i = paramString.length();
      for (byte b = 0; b < i; b++) {
        if (!u(paramString.codePointAt(b)))
          return false; 
      } 
    } 
    return true;
  }
  
  public static String oq(Iterator<?> paramIterator, String paramString) {
    if (!paramIterator.hasNext())
      return ""; 
    String str = paramIterator.next().toString();
    if (!paramIterator.hasNext())
      return str; 
    yh yh = new yh(paramString);
    yh.h(str);
    while (paramIterator.hasNext())
      yh.h(paramIterator.next()); 
    return yh.V0();
  }
  
  public static boolean q(String paramString, String[] paramArrayOfString) {
    boolean bool;
    if (Arrays.binarySearch((Object[])paramArrayOfString, paramString) >= 0) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  public static String t(StringBuilder paramStringBuilder) {
    R2.u(paramStringBuilder);
    String str = paramStringBuilder.toString();
    if (paramStringBuilder.length() > 8192) {
      paramStringBuilder = new StringBuilder(8192);
    } else {
      paramStringBuilder.delete(0, paramStringBuilder.length());
    } 
    Stack<StringBuilder> stack = j.get();
    stack.push(paramStringBuilder);
    while (stack.size() > 8)
      stack.pop(); 
    return str;
  }
  
  public static boolean u(int paramInt) {
    return (paramInt == 32 || paramInt == 9 || paramInt == 10 || paramInt == 12 || paramInt == 13);
  }
  
  class Tw extends ThreadLocal<Stack<StringBuilder>> {
    protected Stack<StringBuilder> h() {
      return new Stack<StringBuilder>();
    }
  }
  
  public static class yh {
    final String V0;
    
    @Nullable
    StringBuilder h = ZG.V0();
    
    boolean j = true;
    
    public yh(String param1String) {
      this.V0 = param1String;
    }
    
    public String V0() {
      String str = ZG.t(this.h);
      this.h = null;
      return str;
    }
    
    public yh h(Object param1Object) {
      R2.u(this.h);
      if (!this.j)
        this.h.append(this.V0); 
      this.h.append(param1Object);
      this.j = false;
      return this;
    }
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/ZG.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */